private MyServer.Downloader downloader;
    private ServiceConnection connection = new ServiceConnection() {
        @Override
        public void onServiceConnected(ComponentName name, IBinder service) {

                downloader = (MyServer.Downloader)service;
                downloader.startDownload();
                downloader.getProgress();


        }

        @Override
        public void onServiceDisconnected(ComponentName name) {


        }
    };
	
	
	Intent  intent = new Intent(MainActivity.this,MyServer.class);
     bindService(intent,connection,BIND_AUTO_CREATE);
	 or  startService();
	 
	 ////////////////then on the service set 
	 private Downloader mBinder=new Downloader();
    class Downloader extends Binder{

        public void  startDownload(){

            Logs.i("stasrtDownload executed");

        }

        public  int getProgress(){

            Logs.i("getProgress executed");

            return 1;
        }
    }
	
	public IBinder onBind(Intent intent) {
        return mBinder;
    }